package sixth.抽象类;
abstract class Person{
    private String name;
    private int age;
    public Person(String name,int age){
        this.setName(name);
        this.setAge(age);
    }
public abstract String getInfo();
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
class Student extends Person{
    private String school;
    public Student(String name,int age,String school){
        super(name,age);
        this.setSchool(school);
    }

    public String getSchool() {
        return school;
    }

    public void setSchool(String school) {
        this.school = school;
    }
    public String getInfo(){//覆写抽象类中的普通方法
       return "姓名："+super.getName()+",年龄："+this.getAge()+",学校："+this.getSchool();
    }
}
public class 调用抽象类中指定参数的构造方法 {
    public static void main(String[] args) {
        Student s = new Student("尼古拉赵四", 18, "常州信息");
        System.out.println(s.getInfo());
    }
}
/**
 * 抽象类和普通类的区别就在于比普通类多定义一个抽象方法，除了不能直接进行对象的实例化操作之外 并没有任何的不同
 */